package com.inheritance.config;

import com.inheritance.interceptors.LoginInterceptors;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Resource
    private LoginInterceptors loginInterceptors;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 处理放行接口
        registry.addInterceptor(loginInterceptors)
                .excludePathPatterns("/user/login", "/user/register", "/**/upload");
    }
}
